package com.tongcheng.controller;

import com.tongcheng.ResultDate;
import com.tongcheng.feign.ActivityseviceFeign;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.http.MediaType;
import org.springframework.web.bind.annotation.*;

import javax.servlet.http.HttpServletRequest;
import java.util.Map;

@RestController
@CrossOrigin
public class ActivityController {
    @Autowired
    private ActivityseviceFeign activityseviceFeign;

    @RequestMapping(value = "/addActivity", method = RequestMethod.POST, produces = MediaType.APPLICATION_JSON_UTF8_VALUE)
    ResultDate addActivity( @RequestBody Map map)  {
        return activityseviceFeign.addActivity(map);
    }
    @RequestMapping(value = "/delActivity",method = RequestMethod.GET,produces =  MediaType.APPLICATION_JSON_UTF8_VALUE)
    public ResultDate delActivity(Integer activity_id) {
        return activityseviceFeign.delActivity(activity_id);
    }
    @GetMapping(value = "/updateActivity",produces =  MediaType.APPLICATION_JSON_UTF8_VALUE)
    public ResultDate updateActivity(@RequestBody Map map){
        return activityseviceFeign.updateActivity(map);
    }
    @GetMapping(value = "/queryActivity",produces =  MediaType.APPLICATION_JSON_UTF8_VALUE)
    public ResultDate queryActivity(Integer activity_id){
        return activityseviceFeign.queryActivity(activity_id);
    }
    @GetMapping(value = "/activity/queryAllActivity",produces =  MediaType.APPLICATION_JSON_UTF8_VALUE)
    public ResultDate queryAllActivity(){
        return activityseviceFeign.queryAllActivity();
    }
}